Skip to content

feat: show emoji-only remote messages larger and without a bubble - #1681

Open
simonhamp wants to merge 1 commit into
dev-null-sh:productionfrom
simonhamp:feat/emoji-only-remotes
Open

simonhamp wants to merge 1 commit into
dev-null-sh:productionfrom
simonhamp:feat/emoji-only-remotes

Conversation

@simonhamp

@simonhamp simonhamp commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

In Remotes, a message that is only emoji sat in the same blue or grey bubble as text, at text size, so a single 🙏 looked like a small pill. This shows those messages the way most chat apps do: no bubble fill, and the emoji at twice the text size.

Changes

  • resources/js/lib/emoji-only.ts adds isEmojiOnly(). It splits the text into graphemes with Intl.Segmenter and accepts emoji with skin tones, ZWJ sequences like 👨‍👩‍👧, flags and keycaps, with any spaces or line breaks between them. Symbols that browsers draw as text unless asked otherwise, like © and ™, don't count, and neither do plain digits or #. It avoids the regex v flag and \p{RGI_Emoji} in case the build target doesn't support them.
  • isBareEmoji() in message-parts.tsx runs that check on the emojified body, so shortcodes like :pray: count too.
  • In BubbleWithMeta the text bubble keeps bubbleClass and adds bg-transparent text-foreground with text-3xl, or text-2xl in the compact dock. The padding and radius stay, so the staged dashed border, the rejected outline and the jump-to-message ring still draw around the same box, and nothing moves when a message changes state. A bare emoji message of your own no longer counts as "on primary", so MessageText uses the normal colours rather than the ones meant for the blue bubble.
  • The long-press preview (LiftedMessage) gets the same treatment. Its box shadow becomes drop-shadow-lg on the emoji itself, because a shadow around an empty box looked wrong.

Any number of emoji goes bare, where iMessage only does it for up to three. A cap is easy to add if you'd rather have one.

Validation

Local, Node 24:

  • node --experimental-strip-types --test tests/Unit/EmojiOnly.test.ts: 4 passed. They cover single and repeated emoji, skin tones, a ZWJ family, a country flag, a tag-sequence flag, a keycap, ❤️, mixed text, punctuation, digits, ©, ™, :) and blank input.
  • vp fmt --check resources/ and vp lint: pass.
  • tsc --noEmit and tsc --noEmit --project tests/tsconfig.json: pass.
  • No PHP changed, so I didn't run Pest.
  • Hosted CI: not run yet.

Visual evidence

All captures come from a local copy with seeded data, in Chrome's headless shell through Playwright at 2x, signed in as the seeded local-dev user on the remote with @conner01. The before shots are the base commit (baa02bbf) built and shown with the same data.

Before, 1440 light After, 1440 light
Emoji-only messages in full bubbles at text size Emoji-only messages larger with no bubble, text messages unchanged
Before, 1440 dark After, 1440 dark
The same thread on production in dark mode The same thread with bare emoji in dark mode

Also checked by hand in a browser at 1440x900:

  • Sending and receiving emoji-only messages shows them bare at 30px.
  • "nice one 🎉" keeps its bubble, and :pray: goes bare.
  • The react and reply actions sit beside a bare emoji on hover.
  • Layout shift, measured with a PerformanceObserver for layout-shift, was 0 for incoming plain-text and emoji messages and for an emoji message going from staged to pushed. The pushed to pulled receipt flip shifts the meta line by 0.00026 for an emoji message and for a plain "ok" alike, so that comes from production, not from this change.

Device verification

No physical device or simulator. The 390x844 shots used Chrome's device emulation (isMobile, hasTouch) through Playwright, so they say nothing about real touch, the on-screen keyboard or safe areas. The composer isn't touched by this change.

Before, 390 light After, 390 light Before, 390 dark After, 390 dark
Emoji-only bubbles on a phone Bare emoji on a phone Emoji-only bubbles on a phone, dark Bare emoji on a phone, dark

Independent review

Not done yet.

Limitations

  • The long-press preview wasn't seen on screen, because I couldn't drive a real long press.
  • 1366x650 wasn't checked, and the compact dock's text-2xl wasn't looked at.
  • Any number of emoji goes bare (see above).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Emoji-only chat messages now appear without a bubble background, with larger emoji and a subtle shadow. This styling applies to emoji entered directly or written as supported shortcodes, while messages containing other text keep their existing appearance.

A remote whose text is only emoji (shortcodes like 🙏 count) now
drops the bubble fill and shows the emoji at text-3xl, or text-2xl in
the compact dock. The bubble keeps its padding and corners, so staged,
rejected and jump-highlight states still line up. The long-press
preview gets the same treatment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds emoji-only detection after shortcode conversion. Chat components use the result to render bare-emoji messages with larger text and transparent backgrounds, and exclude them from primary-message styling. Voice-note rendering remains unchanged.

Changes: Bare-emoji message rendering

Layer / File(s) Summary
Emoji-only detection and tests
resources/js/lib/emoji-only.ts, tests/Unit/EmojiOnly.test.ts
The new detector ignores whitespace and recognizes emoji graphemes, regional-indicator pairs, and keycap sequences. Tests cover emoji-only, mixed-text, and blank inputs.
Bare-emoji message styling
resources/js/components/chat/message-parts.tsx, resources/js/components/chat/conversation-thread.tsx
isBareEmoji checks message text after shortcode conversion. Bare-emoji messages use larger text and transparent backgrounds, and do not receive primary-message styling.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Possibly related PRs

Suggested reviewers: xheaven, nunomaduro

Merge Risk: Minimal · up to 60a5c

Emoji-only chat messages now render as larger emoji without a bubble fill, and text messages are unchanged. The change is a styling update with low blast radius and is easy to revert. No actionable merge-blocking risk is identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title states the main change: emoji-only remote messages are displayed larger and without a bubble. The title is specific, short, and matches the summary and objectives. It names the feature and i…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title states the main change: emoji-only remote messages are displayed larger and without a bubble. The title is specific, short, and matches the summary and objectives. It names the feature and its visible effect, and the 'feat:' prefix follows conventional commit style.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 11f22377-1c60-4757-8618-1178bf130a66
Commits

Reviewing files that changed from the base of the PR and between baa02bb and 60a5ca4.

Files selected for processing: 4

  • resources/js/components/chat/conversation-thread.tsx
  • resources/js/components/chat/message-parts.tsx
  • resources/js/lib/emoji-only.ts
  • tests/Unit/EmojiOnly.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant